part of '../repository.dart';

const _kImageSettingsDataImagesEnabledKey = 'images_enabled';

class _ImageSettingsDataDto extends Equatable {
  const _ImageSettingsDataDto._internal({
    required this.imagesEnabled,
  });

  final bool imagesEnabled;

  @override
  List<Object?> get props {
    return [
      imagesEnabled,
    ];
  }

  factory _ImageSettingsDataDto.fromJson(Map<String, dynamic> json) {
    return _ImageSettingsDataDto._internal(
      imagesEnabled: json[_kImageSettingsDataImagesEnabledKey],
    );
  }

  factory _ImageSettingsDataDto.fromEntity(ImageSettingsData imageSettings) {
    return _ImageSettingsDataDto._internal(
      imagesEnabled: imageSettings.imagesEnabled,
    );
  }

  Map<String, dynamic> toJson() {
    return {
      _kImageSettingsDataImagesEnabledKey: imagesEnabled,
    };
  }

  ImageSettingsData toEntity() {
    return ImageSettingsData(
      imagesEnabled: imagesEnabled,
    );
  }
}
